package com.baomidou.ant.controller;

import com.baomidou.ant.common.Result;
import com.baomidou.ant.service.ILuckDrawService;
import com.baomidou.ant.vo.Response.ResponseLuckDrawOfPointsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author jobob
 * @since 2021-03-24
 */
@RestController
@RequestMapping("/luck-draw")
public class LuckDrawController {
    @Autowired
    private ILuckDrawService luckDrawService;


    //展示我的积分抽奖纪录
    @GetMapping("/listOfPoints/{userId}")
    public Result listOfPoints(@PathVariable Integer userId){
        List<ResponseLuckDrawOfPointsVo> voList=luckDrawService.list(userId,"积分抽奖");
        return Result.getSuccess().setData(voList);
    }

    //展示我的钻石抽奖纪录
    @GetMapping("/listOfDiamonds/{userId}")
    public Result listOfDiamonds(@PathVariable Integer userId){
        List<ResponseLuckDrawOfPointsVo> voList=luckDrawService.list(userId,"钻石抽奖");
        return Result.getSuccess().setData(voList);
    }
}
